<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">     
<head>      
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>易卡会账号管理</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>    
    <#include "../template/include/assign.ftl">
	<#include "../template/include/source.ftl">
	<#include "../template/template_listPage.ftl">    
    <link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
        .page {
            float: right;
            padding-top: 15px;
            margin-right: 15px;
        }
    </style>   
    <script type="text/javascript">    
    function checkDeposit(id){
    	window.location.href = "${web_base}/ekhui/deposit!tocheckdeposit.htm?deposit.depositId="+id ;
    }
    function enableOrDis(id , status){
    	var desc  ;
    	if(status == '1'){
    		desc = '启用' ;
    	}else if(status == '2'){
    		desc = '禁用' ;
    	}
    	$.post(
        		'${web_base}/ekhui/account!enableOrDis.htm?account.accountId=' + id ,
        		{'account.accountState' : status},
        		function(data){
        			if(data == 'true'){
        				alert(desc+'成功') ;
        			}else{
        				alert(desc+'失败') ;
        			}
        			window.location.reload() ;
        		}
        	);
    }
     </script>   
</head>    
<body class="list"> 
     <div class="body">
     	<div class="listBar">
       		<h1><span class="icon">&nbsp;</span>账号管理&nbsp;<span class="pageInfo"></span></h1>
    	</div>
    	
    	
    	<@pageList page=(page!) id="listForm" action="${web_base}/ekhui/account!list.htm" query="accountQuery" isEmpty=true>
    		<div class="operateBar">

			        <label>查找：</label>
			        <input type="submit" id="searchButton" class="searchButton" value=""/>
			  	 	
    		</div>
    		<table class="listTable">
    			<tr>
    				<th>
		                <span class="sort" name="oid_goodsitem">账号号</span>
		            </th>
		            <th>
		                <span class="sort" name="oid_goodsitem">账号名称</span>
		            </th>
		            <th>
		                <span class="sort" name="oid_goodsitem">所属商户</span>
		            </th>
		            <th  style="text-align:center;">
		                <span class="sort" name="name_goods">余额(￥)</span>
		            </th>
		            <th style="text-align:center;">
		                <span class="sort" name="oid_biz">冻结金额(￥)</span>
		            </th>
		            <th>
		                <span class="sort" name="sup_price">创建时间</span>
		            </th>
		            <th>
		                <span class="sort" name="price">账号类型</span>
		            </th>
		            <th>
		                <span class="sort" name="price">账号状态</span>
		            </th>
		            <th width="80">操&nbsp;作
		            <th/>
       		   </tr>
    		   <#if page?? && page.list?? && (page.list?size gt 0)>
    			  <#list page.list as account>
    				 <tr>
    					 <td>
                   		   ${account.accountId!''}
                   		 </td>
    					 <td>
                   		   ${account.accountName!''}
                   		 </td>
                   		  <td>
                   		  ${account.traderName!''}
                   		 </td>
    					 <td style="text-align:right;">
							   	${(account.balance/1000!'')?string("0.000")}
                  		</td>
                   		<td style="text-align:right;">
		                    	${account.freezeMoney/1000!''}
		                </td>
		                <td>
		                	 <#if account.createTime?exists>
						   	 ${account.createTime?string("yyyy-MM-dd HH:mm:ss")}
						   </#if>
		                </td>
		                <td>
		                    <#if account.accountType?exists>
						   	 <#if account.accountType == '1'>
						   			保证金账户
						   		</#if>
						   		<#if account.accountType == '2'>
						   			佣金账户
						   		</#if>
						   </#if>
		                </td>
		                <td>
		                    <#if account.accountState?exists>
						   		<#if account.accountState == '1' >
						   			正常
						   		</#if>
						   		<#if account.accountState == '0'>
						   			待审核
						   		</#if>
						   		<#if account.accountState == '2'>
						   			冻结
						   		</#if>
						   	</#if>
                       </td>
                       <td width="80">
                        <span 
                        <#if account.accountState == '1'>
                        class="spanLink" onclick="enableOrDis('${(account.accountId)!}' , '2');" 
                        title="冻结">[冻结]</span>
                        </#if>
                        <#if account.accountState == '2'>
                        class="spanLink" onclick="enableOrDis('${(account.accountId)!}' , '1');" 
                        title="启用">[启用]</span>
                        </#if>
                        <#if account.accountType?exists>
						   		<#if account.accountType == '2'>
						   			<span class="spanLink"  title="返佣">
						   			<a href="${web_base}/ekhui/account!commission.htm?account.accountId=${(account.accountId)!}">
						   			[返佣]
						   			</a>
						   			</span>
						   		</#if>
						   </#if>
                       </td>
    				 </tr>
    		      </#list>
    		   </#if>
    		</table>
	    	<#if page?? && page.list?? && (page.list?size <= 0)>
		        <div class="noRecord">
		         	   没有找到任何记录!
		        </div>
   			</#if>
     	</@pageList>
     </div>
</body>
</html>   
  